package annotation.bean;

import org.springframework.beans.factory.annotation.Required;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

public class People {
    private Integer age;
    private String name;


    public Integer getAge() {
        return age;
    }
    @Required
    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "People{" + "age=" + age + ", name='" + name + '\'' + '}';
    }

    @PostConstruct
    public void init(){
        System.out.println("People.init");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("People.destroy");
    }
}
